class AddIndices < ActiveRecord::Migration
  def self.up
    add_index :ratings_sideffects, [:rating_id, :sideffect_id]
    add_index :ratings_sideffects, :sideffect_id
    add_index :ratings, :drug_id
    add_index :categories_drugs, [:category_id, :drug_id]
    add_index :categories_drugs, [:drug_id, :category_id]
  end

  def self.down
    remove_index :categories_drugs, [:drug_id, :category_id]
    remove_index :categories_drugs, [:category_id, :drug_id]
    remove_index :ratings, :drug_id
    remove_index :ratings_sideffects, :sideffect_id
    remove_index :ratings_sideffects, [:rating_id, :sideffect_id]
  end
end
